﻿#pragma once
#include "AsGraphicsBasics.h"
#include "AsGraphicsItem.h"

__AS_JY(Update 2023.1.7)
class AS_GRAPHICS_API AsGraphicsLineItem : public AsGraphicsItem {
public:
	explicit AsGraphicsLineItem(QGraphicsItem *parent = nullptr);
	AsGraphicsLineItem(const QLineF& line, QGraphicsItem *parent = nullptr);
	AsGraphicsLineItem(const QLineF& polyline, const QPen& pen = QPen(), QGraphicsItem *parent = nullptr);
	virtual ~AsGraphicsLineItem();

private:
	QLineF mLine;

private:
	void updateBoundingRect(const QLineF& line);

protected:
	void paint(QPainter* painter) override;

public:
	void setLine(const QLineF& line);

};

namespace AsGraphicsNamespace {
	typedef AsGraphicsLineItem LineItem;
};